#!/usr/bin/env python
import sys
import pygtk
pygtk.require('2.0')
import gtk
class Hello:
	def __init__( self ):
		self.window = gtk.Window(gtk.WINDOW_TOPLEVEL )
		self.window.connect( "delete_event", self.delete_event )
		self.window.connect( "destroy", self.destroyy )
		self.window.set_border_width(10)
		self.button = gtk.Button( "HI" )
		self.button.connect( "clicked", self.hello, None)
		self.button.connect_object( "clicked",
		gtk.Widget.destroy, self.window )
		self.window.add(self.button)
		self.button.show()
		self.window.show()
	def destroyy( self, widget, data=None ):
		print "destroy"
		gtk.main_quit()
	def hello( self, widget, data=None ):
		print "Hello"
	def delete_event( self, widget, event, data=None ):
		print "will delete"
		return False
	def main( self ):
		gtk.main()
		print "E"
		sys.exit(0)
print __name__
if __name__ == "__main__":
	hello = Hello()
	hello.main()
